package mysql

import "gorm.io/gorm"

type Brand struct {
	gorm.Model
	BrandName string `gorm:"type:varchar(30);not null;commit:'品牌信息'"`
}

func (b *Brand) BrandFindName(db *gorm.DB, name string) error {
	return db.Debug().Where("brand_name=?", name).FirstOrCreate(b).Error
}
